<html>
    <head>
        <script type="text/javascript">
            function popup(pagina){
                alert(pagina);
            }
        </script>
    </head>
    <body>
        <?php
        //include_once('../includes/utilidades.php');
        include_once('../includes/funciones_consulta.php');
        session_start();

        
        //print_r($_SESSION);
        $temporadaid = $_SESSION['estado']['temporada'][0]['id'];
        $competicionid = $_SESSION['estado']['competicion'][0]['id'];
        $jornadaid = $_SESSION['estado']['jornada'][0]['id'];
        $rpruebajornadaid = $_REQUEST['id'];       

        $temporada = select("select * from temporada", "id=" . $temporadaid);
        $competicion = select("select * from competicion", "id=" . $competicionid);
        $jornada = select("select * from jornada", "id=" . $jornadaid);
        $rpruebajornada = select("select * from vpruebajornada", "id=" . $rpruebajornadaid);
        
        //print_r($rpruebajornada);
//print_r($competicion);
        print "<h1>" . "Seguimiento detallado";
        print "<h1>" . $temporada[0]['nombre'] . "</h1>";
        print "<h2>" . $competicion[0]['nombre'] . "</h2>";
        print "<h3>" . $jornada[0]['nombre'] . " " . $jornada[0]['fecha'] . "</h3>";
        print "<h3>" .   $rpruebajornada[0]['prueba'] . " " . $rpruebajornada[0]['categoria'] . "</h3>";

//$rpruebajornada = select2("select * from rpruebajornada where idjornada=" . $jornadaid . " order by idcategoria");
        $actual = $_SERVER['REQUEST_SCHEME'] . "://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING'];

        print "<form name=detalle action=detalles.php>";
        print "<input type='hidden' name='id' value='".$rpruebajornada[0]['id']."'>";
        print "Ronda: <input type='number' name='ronda' value='1'/>";
        print "Dorsal: <input type='text' name='dorsal'/>";
        print "Marca:<input type='text' name='marca'/>";
        print "<input type=submit value='Aceptar'/>";
        print "</form>";
//print ($actual);
        $html = detalleLongitud();
        foreach ($html as $linea){
            print $linea . "\n";
        }
        ?>
        </body>
        </html>


